<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>7-继承-call</title>
	</head>
	<body>
		<script type="text/javascript">
			function test(x,y){
				console.log(this);
				console.log(x+y);
			}
			//window.test(1,2);
			//test(1,2);
			
			var obj = {
				username:'张端阳',
				age:19
			};
			
			//通过call方法更改this指向,此时的this就是Object {username: "张端阳", age: 19}
			test.call(obj,1,2);
		</script>
	</body>
</html>